<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view(TPL_FOLDER."header");?>
<style type="text/css">
p{ display:inline}
blockquote {background:#F4F5F7 url(../images/common/blockquote.gif) 3px 3px no-repeat;border:1px dashed #CCC;padding:8px 12px 8px 36px;margin:5px 0;}
</style>
<div style="padding:10px">
<div class="ui-tx-nav-bar"><a href="<?php echo site_url(CTL_FOLDER.'home');?>">首页</a><?php echo $nav;?> </div>
<div class="ui-tx-guestbook_nav"><a href="#guestbook_target"><img src="{tpl_path}images/common/gif-0843.gif" style="vertical-align:middle" /> 发布留言</a></div>
<?php foreach($guestbook as $row){?>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="ui-tx-tablelist">
  <thead>
    <tr>
      <th width="40%" align="left"><?php echo $row->user_name;?></th>
      <th width="60%" align="right"><?php echo time_diff($row->create_date);?></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td colspan="2" align="left"><b>游客说：</b><?php echo format_textarea($row->content);?>
      <div class="ui-gb-reply"><b>客服回复：</b><?php echo $row->reply;?></div>
      </td>
    </tr>
  </tbody>
</table>
<?php }?>
<div class="ui-tx-page"><?php echo $paginate;?></div>
<fieldset>
<legend><a name='guestbook_target'></a><img src="{tpl_path}images/common/reg_icon.png" style="vertical-align:middle" /> 发布留言</legend>
<form method="post" action='<?php echo site_url(CTL_FOLDER.'guestbook/save_guestbook');?>'>
  <table width="100%" border="0" cellspacing="5" cellpadding="5">
    <tr>
      <th width="25%" align="right"><font style="color:#FF0000">*</font>姓名（昵称）：</th>
      <td width="75%"><input type="text" size="20" name="user_name" class="ui-tx-input" maxlength="50" dataType="Require" msg="该项必填" /></td>
    </tr>
    <tr>
      <th align="right"><font style="color:#FF0000">*</font>电子邮箱：</th>
      <td><input type="text" size="20" name="email" class="ui-tx-input" maxlength="50" dataType="Email" msg="邮箱格式有误" /></td>
    </tr>
    <tr>
      <th align="right">电话：</th>
      <td><input type="text" size="20" name="tel" class="ui-tx-input" maxlength="50" /></td>
    </tr>
    <tr>
      <th align="right"><font style="color:#FF0000">*</font>留言内容：</th>
      <td><textarea name="content" class="ui-tx-input" cols="50" rows="6" dataType="Limit" min="5" max="500" msg="该项必填,字数在5-500之间"></textarea></td>
    </tr>
    <tr>
      <th align="right"><font style="color:#FF0000">*</font>验证码：</th>
      <td><input name="validate_code" onfocus="get_validate_code('validate_html')" size="5" maxlength="4" id="validate_code" type="text" class="ui-tx-input" dataType="Require" msg="该项必填"/>
        <span id="validate_html"></span></td>
    </tr>
    <tr>
      <th></th>
      <td><input type="button" value="提交" onclick="subForm(this.form,this)" class="ui-tx-button2"></td>
    </tr>
  </table>
</form>
 <div class="clear"></div>
</fieldset>
</div>
<?php $this->load->view(TPL_FOLDER."footer");?>
